//
   Created by 83617 on 2018/12/31.

extends ../layout
block content
   .container
      .row
         .col-md-2
            ul
               li: a(href="/") 社团列表
               li: a(href="/society/detail") 社团信息
               li: a(href="/list/activity") 活动列表
               li: a(href="/admin/society") 社团录入
               li: a(href="/admin/activity") 活动录入
         .col-md-9
            table#mytable.table.table-hover.table-bordered
               thead
                  tr
                     th 社团名字
                     th 人数
                     th 会长
                     th 徽章
                     th 成立时间
                     th 更新
                     th 删除
               tbody
                  each item in societies
                     tr(class="item-id-#{item._id}")
                        td #{item.name}
                        td #{item.num}
                        td #{item.master}
                        td: img(src="/resorce/uploadIcon/#{item.icon}")
                        td #{moment(item.meta.updateAt).format('MM/DD/YYYY')}
                        td: a(traget="_blank",href="../admin/update/society/#{item._id}") 修改
                        td
                           buttom.btn.btn-danger.del(type="button",data-id="#{item._id}") 删除

            nav(aria-label='Page navigation')
               ul.pagination
                  -if(currentPage == 1)
                     li.disabled
                        span(aria-hidden='true') &laquo;
                  -else
                     li
                        a(href='/index/page/switch?page=#{currentPage-1}&con=#{con}', aria-label='Previous')
                           span(aria-hidden='true') &laquo;
                  -for(var i = 0 ; i < totalPage ; i++)
                     -if(currentPage == (i+1))
                        li.active
                           span #{currentPage}
                     -else
                        li
                           a(href='/index/page/switch?page=#{i+1}&con=#{con}') #{i+1}
                  -if(currentPage == totalPage)
                     li.disabled
                        span(aria-hidden='true') &raquo;
                  -else
                     li
                        a(href='/index/page/switch?page=#{currentPage+1}&con=#{con}', aria-label='Next')
                           span(aria-hidden='true') &raquo;

   script(src="/my-js/admin.js")